import Layout from '@/layout'

export default {
  path: '/product',
  component: Layout,
  redirect: '/product/list',
  name: 'Product',
  meta: { title: '商品管理', icon: 'product', noCache: true, roles: ['product'] },
  children: [
    {
      path: 'brand',
      name: 'ProductBrand',
      component: () => import('@/views/product/brand'),
      meta: { title: '品牌管理', icon: 'star', noCache: true },
      redirect: '/product/brand/list',
      children: [
        {
          path: 'create',
          // name: 'BrandCreate',
          component: () => import('@/views/product/brand/create'),
          meta: { title: '添加品牌', noCache: true, icon: 'edit' }
        },
        {
          path: 'edit/:id',
          component: () => import('@/views/product/brand/edit'),
          meta: { title: '编辑品牌', noCache: true /*, activeMenu: '/product/brand/create' */ },
          hidden: true
        },
        {
          path: 'list',
          name: 'BrandList',
          component: () => import('@/views/product/brand/list'),
          meta: { title: '品牌列表', noCache: true, icon: 'list' }
        }
      ]
    },
    {
      path: 'category',
      name: 'ProductCategory',
      component: () => import('@/views/product/category'),
      meta: { title: '分类管理', icon: 'star', noCache: true },
      redirect: '/product/category/list',
      children: [
        {
          path: 'create',
          component: () => import('@/views/product/category/create'),
          meta: { title: '添加分类', noCache: true, icon: 'edit' }
        },
        {
          path: 'edit/:id',
          component: () => import('@/views/product/category/edit'),
          meta: { title: '编辑分类', noCache: true },
          hidden: true
        },
        {
          path: 'list',
          name: 'CategoryList',
          component: () => import('@/views/product/category/list'),
          meta: { title: '分类列表', noCache: true, icon: 'list' }
        },
        {
          path: 'tree',
          name: 'CategoryTree',
          component: () => import('@/views/product/category/tree'),
          meta: { title: '树形展示', noCache: true, icon: 'tree-table' }
        }
      ]
    },
    {
      path: 'area',
      name: 'ProductArea',
      component: () => import('@/views/product/area'),
      meta: { title: '区域管理', icon: 'star', noCache: true },
      redirect: '/product/area/list',
      children: [
        {
          path: 'create',
          component: () => import('@/views/product/area/create'),
          meta: { title: '添加区域', noCache: true, icon: 'edit' },
          hidden: true
        },
        {
          path: 'edit/:id',
          component: () => import('@/views/product/area/edit'),
          meta: { title: '编辑区域', noCache: true },
          hidden: true
        },
        {
          path: 'list',
          name: 'AreaList',
          component: () => import('@/views/product/area/list'),
          meta: { title: '区域列表', noCache: true, icon: 'star' }
        }
      ]
    },
    {
      path: 'list',
      name: 'ProductList',
      component: () => import('@/views/product/list'),
      meta: { title: '商品列表', icon: 'list', noCache: true }
    },
    {
      path: 'create',
      name: 'ProductCreate',
      component: () => import('@/views/product/create'),
      meta: { title: '添加商品', icon: 'edit', noCache: true }
    },
    {
      path: 'edit/:id',
      component: () => import('@/views/product/edit'),
      meta: { title: '编辑商品', icon: 'edit', noCache: true },
      hidden: true
    },
    {
      path: 'sku-create/:product_id',
      component: () => import('@/views/product/sku/create'),
      meta: { title: '添加规格', noCache: true },
      hidden: true
    },
    {
      path: 'sku-edit/:product_id/:id',
      component: () => import('@/views/product/sku/edit'),
      meta: { title: '编辑编辑', noCache: true },
      hidden: true
    },
    {
      path: 'sku-list/:product_id',
      component: () => import('@/views/product/sku/list'),
      meta: { title: '规格列表', noCache: true },
      hidden: true
    }
  ]
}
